package routes

import (
	"game-server/app/controllers/admin"
	"game-server/app/middleware"
	"game-server/app/services"

	"github.com/gin-gonic/gin"
)

func SetTagGroupRoutes(router *gin.RouterGroup) {
	frontRouter := router.Group("/front")
	{
		frontRouter.GET("/tag/list", admin.TagFrontAll)
		frontRouter.POST("/tag/list", admin.TagFrontList) // 改为 POST 请求，支持分页参数
		//根据tagid获取有该tag的游戏
		frontRouter.POST("/tag/taggame", admin.TagGameList)

	}

	adminRouter := router.Group("/admin").Use(middleware.JWTAuth(services.AdminGuardName))
	{
		adminRouter.POST("/tag/add", admin.TagAdd)       // tag添加
		adminRouter.POST("/tag/list", admin.TagList)     // tag列表
		adminRouter.POST("/tag/del", admin.TagDel)       // 游戏删除
		adminRouter.POST("/tag/update", admin.TagUpdate) // 游戏修改

		//批量添加游戏
		adminRouter.POST("/tag/batchadd", admin.TagBatchAddGame)
		//获取所有tag
		adminRouter.GET("/tag/all", admin.TagAll)
	}
}
